package com.mcxx.modules.miniSalvation.order.service.write;

import com.mcxx.common.exception.BizException;
import com.mcxx.modules.miniSalvation.order.dao.write.AreaMoveWriteDao;
import com.mcxx.modules.miniSalvation.order.entity.AreaMoveEntity;
import com.mcxx.util.FailureCode;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@TaTransactional
public class AreaMoveWriteService {
    @Autowired
    private AreaMoveWriteDao areaMoveWriteDao;



    public void insert(AreaMoveEntity areaMove){
        int rst = areaMoveWriteDao.insert(areaMove);
        if(rst <= 0){
            throw new BizException(FailureCode.ERR_9999);
        }
    }


    public void inserts(List<AreaMoveEntity> areaMoveEntityList){
        int rst = areaMoveWriteDao.inserts(areaMoveEntityList);
        if(rst <= 0){
            throw new BizException(FailureCode.ERR_9999);
        }
    }
}
